package server.xml;

import server.util.RequestUtil;

import java.util.ArrayList;
import java.util.List;

public class ServletMap {
    private String servletName = null;
    private List<String> urlPatterns = new ArrayList<>();

    public String getServletName() {
        return servletName;
    }

    public void setServletName(String servletName) {
        this.servletName = servletName;
    }

    public List<String> getUrlPatterns() {
        return urlPatterns;
    }

    public void addUrlPattern(String urlPattern) {
        urlPatterns.add(RequestUtil.URLDecode(urlPattern));
    }

    @Override
    public String toString() {
        return "ServletMapping{" +
                "servletName='" + servletName + '\'' +
                ", urlPatterns=" + urlPatterns +
                '}';
    }
}
